package org.dyyx.nrest.controller;

import java.time.LocalDateTime;
import java.util.Date;

import org.dyyx.nrest.annotation.GetMapping;
import org.dyyx.nrest.annotation.JsonResponse;
import org.dyyx.nrest.annotation.RestController;
import org.dyyx.nrest.rest.ResponseEntity;

@RestController
public class HelloController {
	
	  
    @GetMapping("/hello")
    @JsonResponse
    public ResponseEntity<String> hello() {   
        return ResponseEntity.ok().build("hello,netty-rest,"+LocalDateTime.now());
    }
    
	
	//  /  HTTP ERROR 404
	// @GetMapping("/")
	// HTTP ERROR 404
	@GetMapping("")
    @JsonResponse
    public ResponseEntity<String> home() {   
        return hello();
		// return ResponseEntity.ok().build("hello,netty-rest,"+LocalDateTime.now());
    }

  
    

}
